#!/bin/bash

# 删除就jar
# 下载jar
#
rm -rf /home/admin/nong_shi_tong/nginx/qy/*
rm -rf /home/admin/nong_shi_tong/nginx/yy/*

mc cp myminio/archive/nong_shi_tong/enterprise-web/nst-enterprise-latest.tar.gz /home/admin/nong_shi_tong/nginx/qy
mc cp myminio/archive/nong_shi_tong/manager-web/nst-manager-latest.tar.gz /home/admin/nong_shi_tong/nginx/yy

tar -xzvf /home/admin/nong_shi_tong/nginx/qy/nst-enterprise-latest.tar.gz -C  /home/admin/nong_shi_tong/nginx/qy --strip-components=1 
tar -xzvf /home/admin/nong_shi_tong/nginx/yy/nst-manager-latest.tar.gz -C /home/admin/nong_shi_tong/nginx/yy --strip-components=1 

rm -rf /home/admin/nong_shi_tong/nginx/qy/*tar.gz
rm -rf /home/admin/nong_shi_tong/nginx/yy/*tar.gz

# 重启docker compose
# docker compose up --build -d
